package com.atguigu.gmall.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: atguigu
 * @create: 2023-05-04 11:33
 */

@Controller
public class LoginContrller {

    /**
     * 渲染登录页面
     * @param model
     * @param originUrl 登录前访问页面地址
     * @return
     */
    @GetMapping("/login.html")
    public String loginHtml(Model model, @RequestParam("originUrl") String originUrl) {
        model.addAttribute("originUrl", originUrl);
        return "/login";
    }
}
